package com.wealth.scsj.b_app.presenter;

import android.util.Log;

import com.wealth.scsj.b_app.base.GetShopScoreBase;
import com.wealth.scsj.b_app.base.RefusedRefundBase;
import com.wealth.scsj.b_app.bean.GetEvaluationNumBean;
import com.wealth.scsj.b_app.bean.GetShopScoreBean;
import com.wealth.scsj.b_app.bean.ShoperRefusedRefundBean;
import com.wealth.scsj.b_app.model.GetShopScoreModel;
import com.wealth.scsj.b_app.model.RefusedRefundModel;

import dkmvp.mvp.BasePresenter;
import dkmvp.net.ResponseCallback;
import okhttp3.RequestBody;

/**
 * 修改登录密码presenter
 */

public class GetShopScorePresenter extends BasePresenter implements GetShopScoreBase.IPresenter {

    private GetShopScoreBase.IModel mModel;
    private GetShopScoreBase.IView mView;

    public GetShopScorePresenter(GetShopScoreBase.IView view) {
        mView = view;
        mModel = new GetShopScoreModel();

    }


    @Override
    public void deliverData(RequestBody requestBody) {
        addSubscription(mModel.getData(requestBody, new ResponseCallback<GetShopScoreBean>() {
            @Override
            public void onSuccess(GetShopScoreBean result) {
                if (result.getStatusCode() == 200) {
                    mView.showSuccessMsg("登录密码修改成功", result);
                } else {
                    mView.showErrorMsg(result.getMsg());
                }
            }

            @Override
            public void onFaild(String msg) {
                mView.showErrorMsg(msg);
                Log.e("修改登录密码onFaild", msg + "");
            }
        }));
    }



}
